import { RouteRecordRaw } from "vue-router";

export default [
  {
    name: "preview",
    path: "/preview",
    meta: { name: "预览", role: ["admin"] },
    redirect: "/preview/workspace",
    component: () => import("@/layout/index.vue"),
    children: [
      {
        name: "workspace",
        path: "workspace",
        component: () => import("@/views/preview/workspace.vue"),
        meta: { name: "工作台" },
      },
      {
        name: "analytics",
        path: "analytics",
        component: () => import("@/views/preview/analytics.vue"),
        meta: { name: "分析页" },
      },
    ],
  },
  // settings
  {
    name: "setting",
    path: "/setting",
    component: () => import("@/layout/index.vue"),
    meta: { name: "设置", role: ["admin"] },
    children: [
      {
        name: "userSetting",
        path: "userSetting",
        component: () => import("@/views/preview/workspace.vue"),
        meta: { name: "账号管理" },
      },
      {
        name: "roleSetting",
        path: "roleSetting",
        component: () => import("@/views/preview/workspace.vue"),
        meta: { name: "角色管理" },
      },
      {
        name: "authSetting",
        path: "authSetting",
        component: () => import("@/views/preview/workspace.vue"),
        meta: { name: "权限管理" },
      },
      {
        name: "menuSetting",
        path: "menuSetting",
        component: () => import("@/views/preview/workspace.vue"),
        meta: { name: "菜单管理" },
      },
    ],
  },
  // antvx6
  {
    name: "graph",
    path: "/graph",
    component: () => import("@/layout/index.vue"),
    meta: { name: "图形" },
    children: [
      {
        name: "test",
        path: "test",
        meta: { name: "测试" },
        component: () => import("@/views/graph/index.vue"),
      },
    ],
  },
  // func
  {
    name: "func",
    path: "/func",
    meta: { name: "功能" },
    component: () => import("@/layout/index.vue"),
    children: [
      {
        name: "resetState",
        path: "resetState",
        meta: { name: "重置状态" },
        component: () => import("@/views/func/ResetRef/index.vue"),
      },
      {
        name: "virtualListExample",
        path: "virtualListExample",
        meta: { name: "虚拟滚动" },
        component: () => import("@/views/func/virtualListExample.vue"),
      },
      {
        name: "webWorkerExample",
        path: "webWorkerExample",
        meta: { name: "webWorker示例" },
        component: () => import("@/views/func/webWorker/example.vue"),
      },
      {
        name: "chartExampleByScale",
        path: "chartExampleByScale",
        meta: { name: "echarts示例-scale" },
        component: () => import("@/views/func/echartExample/chartExampleByScale.vue"),
      },
      {
        name: "chartExampleByVwVh",
        path: "chartExampleByVwVh",
        meta: { name: "echarts示例-vwvh" },
        component: () => import("@/views/func/echartExample/chartExampleByVwVh.vue"),
      },
    ],
  },
] as RouteRecordRaw[];
